<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>Document</title>
        <script>
            /* 
                Object.assign 合并对象
                【注】将所有传入的对象，都合并到第一个对象中。

            
                浅拷贝:只拷贝地址
                深拷贝:将复合数据类型重新生成一份，进行拷贝
            */
           var obj1 = {
               a: 10
           }
           var obj2 = {
               b: 20,
               c: 30
           }
           var obj3 = {
               d: 40,
               f: ["hello", "world", true]
           }

           Object.assign(obj1, obj2, obj3);

           
          /*  obj2.b = 100;
           console.log(obj2);
           console.log(obj1); */

           obj3.f.push("xxx");
           console.log(obj3);
           console.log(obj1);
           
        </script>
    </head>
    <body>
        
    </body>
</html>